(function(){
	var Dialog=window.Dialog=function(){
		this.getFunc(this,Dialog._objParent)();
	}.extend(Base);
	pt=Dialog.prototype;
	//3类对话框
	pt.alert=function(p_jsnPara){
		p_jsnPara=p_jsnPara instanceof Object?p_jsnPara:{};
		if(!this._arrPrivate['alertContainer']){// 防止多次创建对话框
			this._arrPrivate['alertContainer']=document.createElement('div');
			p_jsnPara.alertid?this._arrPrivate['alertContainer'].id=p_jsnPara.alertid:'';
			this._arrPrivate['alertContainer'].className=p_jsnPara.alertContainerClassName?p_jsnPara.alertContainerClassName:'alertcontainer';
			this.setProps(this._arrPrivate['alertContainer'],{
				style:{
					zIndex:this._arrPrivate['divCover']?this._arrPrivate['divCover'].style.zIndex+1:11
				}
			});
			var alertTbl=document.createElement('table');
			alertTbl.className=p_jsnPara.alertTblClassName?p_jsnPara.alertTblClassName:'alerttbl';

			var alertTblTrTitle=alertTbl.insertRow(0);
			var alertTblTdTitle=alertTblTrTitle.insertCell(0);
			alertTblTdTitle.colSpan=2;
			alertTblTdTitle.className=p_jsnPara.alertTblTdTitleClassName?p_jsnPara.alertTblTdTitleClassName:'alerttbltdtitle';

			var alertTblTrStr=alertTbl.insertRow(1);
			var alertTblTdImg=alertTblTrStr.insertCell(0);
			alertTblTdImg.className=p_jsnPara.alertTblTdImgClassName?p_jsnPara.alertTblTdImgClassName:'alerttbltdimg';
			var alertTblDivImg=document.createElement('div');
			alertTblDivImg.className=p_jsnPara.alertTblDivImgClassName?p_jsnPara.alertTblDivImgClassName:'alertimg';
			this.appendEle(alertTblTdImg,alertTblDivImg);

			var alertTblTdStr=alertTblTrStr.insertCell(1);
			alertTblTdStr.className=p_jsnPara.alertTblTdStrClassName?p_jsnPara.alertTblTdStrClassName:'alerttbltdstr';

			var alertTblTrBtn=alertTbl.insertRow(2);
			var alertTblTdBtn=alertTblTrBtn.insertCell(0);
			alertTblTdBtn.colSpan=2;
			alertTblTdBtn.className=p_jsnPara.alertTblTdBtnClassName?p_jsnPara.alertTblTdBtnClassName:'alerttbltdbtn';

			var alertTblBtn=document.createElement('input');
			alertTblBtn.type='button';
			alertTblBtn.className=p_jsnPara.alertTblBtnClassName?p_jsnPara.alertTblBtnClassName:'alerttblbtn';
			this.appendEle(alertTblTdBtn,alertTblBtn);
			
			this.bindEvent(alertTblBtn,'click',this.getFunc(this,this.diaCallBack,this._arrPrivate['alertContainer']));

			this.appendEle(this._arrPrivate['alertContainer'],alertTbl);
			this.appendEle(document.body,this._arrPrivate['alertContainer']);
		}
		
		if(this._arrPrivate['alertContainer'].yesfunc){
			this.removeEvent(this._arrPrivate['alertContainer'].childNodes[0].rows[2].cells[0].childNodes[0],this._arrPrivate['alertContainer'].yesfunc);
		}
		p_jsnPara.yesCallBack?this.bindEvent(this._arrPrivate['alertContainer'].childNodes[0].rows[2].cells[0].childNodes[0],'click',this._arrPrivate['alertContainer'].yesfunc=this.getFunc(
				p_jsnPara.yesObject?p_jsnPara.yesObject:this,p_jsnPara.yesCallBack)):'';
		
		this._arrPrivate['alertContainer'].childNodes[0].rows[0].cells[0].innerHTML=p_jsnPara.title?p_jsnPara.title:'Title';
		this._arrPrivate['alertContainer'].childNodes[0].rows[1].cells[1].innerHTML=p_jsnPara.alertstr?p_jsnPara.alertstr:'String';
		this._arrPrivate['alertContainer'].childNodes[0].rows[2].cells[0].childNodes[0].value=p_jsnPara.btnstr?p_jsnPara.btnstr:'OK';
		this.startCover({
			closeobj:this._arrPrivate['alertContainer'].childNodes[0].rows[2].cells[0].childNodes[0]
		});
		this.setProps(this._arrPrivate['alertContainer'],{
			style:{
				display:'block'
			}
		});
		this.setCenter(this._arrPrivate['alertContainer']);
		this.setProps(this._arrPrivate['alertContainer'],{
			style:{
				visibility:'visible'
			}
		});
	};
	pt.diaCallBack=function(container){
		this.setProps(container,{
			style:{
				display:'none',
				visibility:'hidden'
			}
		});
	};
	pt.confirm=function(p_jsnPara){
		p_jsnPara=p_jsnPara instanceof Object?p_jsnPara:{};
		if(!this._arrPrivate['confirmContainer']){// 防止多次创建对话框
			this._arrPrivate['confirmContainer']=document.createElement('div');
			p_jsnPara.confirmid?this._arrPrivate['confirmContainer'].id=p_jsnPara.confirmid:'';
			this._arrPrivate['confirmContainer'].className=p_jsnPara.confirmContainerClassName?p_jsnPara.confirmContainerClassName:'confirmcontainer';
			this.setProps(this._arrPrivate['confirmContainer'],{
				style:{
					zIndex:this._arrPrivate['divCover']?this._arrPrivate['divCover'].style.zIndex+1:11
				}
			});
			var confirmTbl=document.createElement('table');
			confirmTbl.className=p_jsnPara.confirmTblClassName?p_jsnPara.confirmTblClassName:'confirmtbl';

			var confirmTblTrTitle=confirmTbl.insertRow(0);
			var confirmTblTdTitle=confirmTblTrTitle.insertCell(0);
			confirmTblTdTitle.colSpan=2;
			confirmTblTdTitle.className=p_jsnPara.confirmTblTdTitleClassName?p_jsnPara.confirmTblTdTitleClassName:'confirmtbltdtitle';

			var confirmTblTrStr=confirmTbl.insertRow(1);
			var confirmTblTdImg=confirmTblTrStr.insertCell(0);
			confirmTblTdImg.className=p_jsnPara.confirmTblTdImgClassName?p_jsnPara.confirmTblTdImgClassName:'confirmtbltdimg';
			var confirmTblDivImg=document.createElement('div');
			confirmTblDivImg.className=p_jsnPara.confirmTblDivImgClassName?p_jsnPara.confirmTblDivImgClassName:'confirmimg';
			this.appendEle(confirmTblTdImg,confirmTblDivImg);

			var confirmTblTdStr=confirmTblTrStr.insertCell(1);
			confirmTblTdStr.className=p_jsnPara.confirmTblTdStrClassName?p_jsnPara.confirmTblTdStrClassName:'confirmtbltdstr';

			var confirmTblTrBtn=confirmTbl.insertRow(2);
			var confirmTblTdBtn=confirmTblTrBtn.insertCell(0);
			confirmTblTdBtn.colSpan=2;
			confirmTblTdBtn.className=p_jsnPara.confirmTblTdBtnClassName?p_jsnPara.confirmTblTdBtnClassName:'confirmtbltdbtn';

			var confirmTblYesBtn=document.createElement('input');
			var confirmTblNoBtn=document.createElement('input');
			confirmTblYesBtn.type='button';
			confirmTblYesBtn.className=p_jsnPara.confirmTblBtnClassName?p_jsnPara.confirmTblBtnClassName:'confirmtblbtn';
			confirmTblNoBtn.type='button';
			confirmTblNoBtn.className=p_jsnPara.confirmTblBtnClassName?p_jsnPara.confirmTblBtnClassName:'confirmtblbtn';
			this.appendEle(confirmTblTdBtn,confirmTblYesBtn);
			this.appendEle(confirmTblTdBtn,confirmTblNoBtn);

			this.bindEvent(confirmTblYesBtn,'click',this.getFunc(this,this.endCover));
			this.bindEvent(confirmTblYesBtn,'click',this.getFunc(this,this.diaCallBack,this._arrPrivate['confirmContainer']));
			this.bindEvent(confirmTblNoBtn,'click',this.getFunc(this,this.diaCallBack,this._arrPrivate['confirmContainer']));

			this.appendEle(this._arrPrivate['confirmContainer'],confirmTbl);
			this.appendEle(document.body,this._arrPrivate['confirmContainer']);
		}
		if(this._arrPrivate['confirmContainer'].yesfunc){
			this.removeEvent(this._arrPrivate['confirmContainer'].childNodes[0].rows[2].cells[0].childNodes[0],this._arrPrivate['confirmContainer'].yesfunc);
		}
		if(this._arrPrivate['confirmContainer'].nofunc){
			this.removeEvent(this._arrPrivate['confirmContainer'].childNodes[0].rows[2].cells[0].childNodes[1],this._arrPrivate['confirmContainer'].nofunc);
		}
		p_jsnPara.yesCallBack?this.bindEvent(this._arrPrivate['confirmContainer'].childNodes[0].rows[2].cells[0].childNodes[0],'click',this._arrPrivate['confirmContainer'].yesfunc=this.getFunc(
				p_jsnPara.yesObject?p_jsnPara.yesObject:this,p_jsnPara.yesCallBack)):'';
		p_jsnPara.noCallBack?this.bindEvent(this._arrPrivate['confirmContainer'].childNodes[0].rows[2].cells[0].childNodes[1],'click',this._arrPrivate['confirmContainer'].nofunc=this.getFunc(
				p_jsnPara.noObject?p_jsnPara.noObject:this,p_jsnPara.noCallBack)):'';
		this._arrPrivate['confirmContainer'].childNodes[0].rows[0].cells[0].innerHTML=p_jsnPara.title?p_jsnPara.title:'Title';
		this._arrPrivate['confirmContainer'].childNodes[0].rows[1].cells[1].innerHTML=p_jsnPara.confirmstr?p_jsnPara.confirmstr:'String';
		p_jsnPara.confirmobj?this.appendEle(this._arrPrivate['confirmContainer'].childNodes[0].rows[1].cells[1],p_jsnPara.confirmobj):'';
		this._arrPrivate['confirmContainer'].childNodes[0].rows[2].cells[0].childNodes[0].value=p_jsnPara.yesbtnstr?p_jsnPara.yesbtnstr:'YES';
		this._arrPrivate['confirmContainer'].childNodes[0].rows[2].cells[0].childNodes[1].value=p_jsnPara.nobtnstr?p_jsnPara.nobtnstr:'NO';
		this.startCover({
			closeobj:this._arrPrivate['confirmContainer'].childNodes[0].rows[2].cells[0].childNodes[1]
		});
		this.setProps(this._arrPrivate['confirmContainer'],{
			style:{
				display:'block'
			}
		});
		this.setCenter(this._arrPrivate['confirmContainer']);
		this.setProps(this._arrPrivate['confirmContainer'],{
			style:{
				visibility:'visible'
			}
		});
	};
	pt.prompt=function(p_jsnPara){
		p_jsnPara=p_jsnPara instanceof Object?p_jsnPara:{};
		if(!this._arrPrivate['promptContainer']){
			this._arrPrivate['promptContainer']=document.createElement('div');
			p_jsnPara.promptid?this._arrPrivate['promptContainer'].id=p_jsnPara.promptid:'';
			this._arrPrivate['promptContainer'].className=p_jsnPara.promptContainerClassName?p_jsnPara.promptContainerClassName:'promptcontainer';
			this.setProps(this._arrPrivate['promptContainer'],{
				style:{
					zIndex:this._arrPrivate['divCover']?this._arrPrivate['divCover'].style.zIndex+1:11
				}
			});
			var promptTbl=document.createElement('table');
			promptTbl.className=p_jsnPara.promptTblClassName?p_jsnPara.promptTblClassName:'prompttbl';

			var promptTblTrTitle=promptTbl.insertRow(0);
			var promptTblTdTitle=promptTblTrTitle.insertCell(0);
			promptTblTdTitle.colSpan=2;
			promptTblTdTitle.className=p_jsnPara.promptTblTdTitleClassName?p_jsnPara.promptTblTdTitleClassName:'prompttbltdtitle';

			var promptTblTrStr=promptTbl.insertRow(1);
			var promptTblTdImg=promptTblTrStr.insertCell(0);
			promptTblTdImg.rowSpan=2;
			promptTblTdImg.className=p_jsnPara.promptTblTdImgClassName?p_jsnPara.promptTblTdImgClassName:'prompttbltdimg';
			var promptTblDivImg=document.createElement('div');
			promptTblDivImg.className=p_jsnPara.promptTblDivImgClassName?p_jsnPara.promptTblDivImgClassName:'promptimg';
			this.appendEle(promptTblTdImg,promptTblDivImg);

			var promptTblTdStr=promptTblTrStr.insertCell(1);
			promptTblTdStr.className=p_jsnPara.promptTblTdStrClassName?p_jsnPara.promptTblTdStrClassName:'prompttbltdstr';

			var promptTblTrData=promptTbl.insertRow(2);
			var promptTblTdData=promptTblTrData.insertCell(0);
			promptTblTdData.className=p_jsnPara.promptTblTdDataClassName?p_jsnPara.promptTblTdDataClassName:'prompttbltddata';
			var promptTblInputData=document.createElement('input');
			promptTblInputData.type='text';
			promptTblInputData.className=p_jsnPara.promptTblInputDataClassName?p_jsnPara.promptTblInputDataClassName:'prompttblinputdata';
			this.appendEle(promptTblTdData,promptTblInputData);

			var promptTblTrBtn=promptTbl.insertRow(3);
			var promptTblTdBtn=promptTblTrBtn.insertCell(0);
			promptTblTdBtn.colSpan=2;
			promptTblTdBtn.className=p_jsnPara.promptTblTdBtnClassName?p_jsnPara.promptTblTdBtnClassName:'prompttbltdbtn';

			var promptTblYesBtn=document.createElement('input');
			var promptTblNoBtn=document.createElement('input');
			promptTblYesBtn.type='button';
			promptTblYesBtn.className=p_jsnPara.promptTblBtnClassName?p_jsnPara.promptTblBtnClassName:'prompttblbtn';
			promptTblNoBtn.type='button';
			promptTblNoBtn.className=p_jsnPara.promptTblBtnClassName?p_jsnPara.promptTblBtnClassName:'prompttblbtn';
			this.appendEle(promptTblTdBtn,promptTblYesBtn);
			this.appendEle(promptTblTdBtn,promptTblNoBtn);

			this.bindEvent(promptTblYesBtn,'click',this.getFunc(this,this.endCover));
			this.bindEvent(promptTblYesBtn,'click',this.getFunc(this,this.diaCallBack,this._arrPrivate['promptContainer']));
			this.bindEvent(promptTblNoBtn,'click',this.getFunc(this,this.diaCallBack,this._arrPrivate['promptContainer']));

			this.appendEle(this._arrPrivate['promptContainer'],promptTbl);
			this.appendEle(document.body,this._arrPrivate['promptContainer']);
		}

		if(this._arrPrivate['promptContainer'].yesfunc){
			this.removeEvent(this._arrPrivate['promptContainer'].childNodes[0].rows[3].cells[0].childNodes[0],this._arrPrivate['promptContainer'].yesfunc);
		}
		if(this._arrPrivate['promptContainer'].nofunc){
			this.removeEvent(this._arrPrivate['promptContainer'].childNodes[0].rows[3].cells[0].childNodes[1],this._arrPrivate['promptContainer'].nofunc);
		}
		p_jsnPara.yesCallBack?this.bindEvent(this._arrPrivate['promptContainer'].childNodes[0].rows[3].cells[0].childNodes[0],'click',this._arrPrivate['promptContainer'].yesfunc=this.getFunc(
				p_jsnPara.yesObject?p_jsnPara.yesObject:this,this.getFunc(this,this.getPromptData,[p,this._arrPrivate['promptContainer'].childNodes[0].rows[2].cells[0].childNodes[0]]))):'';
		p_jsnPara.noCallBack?this.bindEvent(this._arrPrivate['promptContainer'].childNodes[0].rows[3].cells[0].childNodes[1],'click',this._arrPrivate['promptContainer'].nofunc=this.getFunc(
				p_jsnPara.noObject?p_jsnPara.noObject:this,p_jsnPara.noCallBack)):'';

		this._arrPrivate['promptContainer'].childNodes[0].rows[0].cells[0].innerHTML=p_jsnPara.title?p_jsnPara.title:'Title';
		this._arrPrivate['promptContainer'].childNodes[0].rows[1].cells[1].innerHTML=p_jsnPara.promptstr?p_jsnPara.promptstr:'String';
		this._arrPrivate['promptContainer'].childNodes[0].rows[2].cells[0].childNodes[0].value=p_jsnPara.defaultvalue?p_jsnPara.defaultvalue:'';
		this._arrPrivate['promptContainer'].childNodes[0].rows[3].cells[0].childNodes[0].value=p_jsnPara.yesbtnstr?p_jsnPara.yesbtnstr:'YES';
		this._arrPrivate['promptContainer'].childNodes[0].rows[3].cells[0].childNodes[1].value=p_jsnPara.nobtnstr?p_jsnPara.nobtnstr:'NO';
		this.startCover({
			closeobj:this._arrPrivate['promptContainer'].childNodes[0].rows[3].cells[0].childNodes[1]
		});
		this.setProps(this._arrPrivate['promptContainer'],{
			style:{
				display:'block'
			}
		});
		this.setCenter(this._arrPrivate['promptContainer']);
		this.setProps(this._arrPrivate['promptContainer'],{
			style:{
				visibility:'visible'
			}
		});
	};
	//取得prompt的值
	pt.getPromptData=function(p_jsnPara,o){
		var obj=p_jsnPara.yesObject?p_jsnPara.yesObject:this;
		p_jsnPara.yesCallBack.call(obj,[o.value]);
	};
	pt.show=function(p_jsnPara){
		p_jsnPara=p_jsnPara instanceof Object?p_jsnPara:{};
		if(!this._arrPrivate['showContainer']){
			this._arrPrivate['showContainer']=document.createElement('div');
			p_jsnPara.showid?this._arrPrivate['showContainer'].id=p_jsnPara.showid:'';
			this._arrPrivate['showContainer'].className=p_jsnPara.showContainerClassName?p_jsnPara.showContainerClassName:'showcontainer';
			this.setProps(this._arrPrivate['showContainer'],{
				style:{
					zIndex:this._arrPrivate['divCover']?this._arrPrivate['divCover'].style.zIndex+1:11
				}
			});
			var showTbl=document.createElement('table');
			showTbl.className=p_jsnPara.showTblClassName?p_jsnPara.showTblClassName:'showtbl';

			var showTblTrTitle=showTbl.insertRow(0);
			var showTblTdTitle=showTblTrTitle.insertCell(0);
			showTblTdTitle.colSpan=2;
			showTblTdTitle.className=p_jsnPara.showTblTdTitleClassName?p_jsnPara.showTblTdTitleClassName:'showtbltdtitle';

			var showTblTrStr=showTbl.insertRow(1);
			var showTblTdImg=showTblTrStr.insertCell(0);
			showTblTdImg.className=p_jsnPara.showTblTdImgClassName?p_jsnPara.showTblTdImgClassName:'showtbltdimg';
			var showTblDivImg=document.createElement('div');
			showTblDivImg.className=p_jsnPara.showTblDivImgClassName?p_jsnPara.showTblDivImgClassName:'showimg';
			this.appendEle(showTblTdImg,showTblDivImg);

			var showTblTdStr=showTblTrStr.insertCell(1);
			showTblTdStr.className=p_jsnPara.showTblTdStrClassName?p_jsnPara.showTblTdStrClassName:'showtbltdstr';

			this.appendEle(this._arrPrivate['showContainer'],showTbl);
			this.appendEle(document.body,this._arrPrivate['showContainer']);
		}
		this._arrPrivate['showContainer'].childNodes[0].rows[0].cells[0].innerHTML=p_jsnPara.title?p_jsnPara.title:'Title';
		this._arrPrivate['showContainer'].childNodes[0].rows[1].cells[1].innerHTML=p_jsnPara.showstr?p_jsnPara.showstr:'String';
		this.startCover({
			closeobj:'ajax'
		});
		this.setProps(this._arrPrivate['showContainer'],{
			style:{
				display:'block'
			}
		});
		this.setCenter(this._arrPrivate['showContainer']);
		this.setProps(this._arrPrivate['showContainer'],{
			style:{
				visibility:'visible'
			}
		});
	};
	pt.closeshow=function(){
		this.endCover();
		this.setProps(this._arrPrivate['showContainer'],{
			style:{
				display:'none'
			}
		});
		this.setProps(this._arrPrivate['showContainer'],{
			style:{
				visibility:'hidden'
			}
		});
	};
	/* 用户体验增强函数 end */
})();
var Dialog=new Dialog();